package com.zkteco.biosecurity.${moduleName}.entity;

import java.io.Serializable;
import java.util.Date;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * @author by code create
 * @create ${createTime}
 * @since 1.0
 * @see 
 */
@Entity
@Table(name="${tableName}")
public class ${modelName?cap_first} implements Serializable{
	private static final long serialVersionUID = 1L;
<#list fields as field>
	<#if field.name='id'>
	@Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_${tableName}")
    @GenericGenerator(name = "seq_${tableName}", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
            parameters = {
                    @org.hibernate.annotations.Parameter(name = "sequence_name", value = "seq_${tableName}")
            })
    private Long id;
	<#else>
	<#assign type = field.type>
	<#if field.type == 'Timestamp'>
		<#assign type = 'Date'>
	</#if>
	
	@Column(name="${field.tableFieldName}")
	private ${type} ${field.name};
	</#if>
</#list>

<#list fields as field>
	<#if field.name='id'>
	public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
	<#else>
	<#assign type = field.type>
	<#if field.type == 'Timestamp'>
		<#assign type = 'Date'>
	</#if>
	
	public void set${field.name?cap_first}(${type} ${field.name}) {
		this.${field.name} = ${field.name};
	}
	
	public ${type} get${field.name?cap_first}() {
		return ${field.name};
	}
	</#if>
</#list>
}
